{extend name="public/base" /} {block name="body"}
<link rel="stylesheet" href="__LIB__/bootstrap-select/css/bootstrap-select.min.css">
<div class="content-tabs">
	<ol class="breadcrumb">
		<li>
			<a href="{:url('index/index')}"><i class="fa fa-home"></i></a>
		</li>
		<li><strong>日志配置</strong></li>
	</ol>
</div>
<div class="row">
	<div class="col-xs-12">
		<div class="float-e-margins">
			{include file="system/top"}
			<div class="ibox-content">
				<form id="myForm" class="form-horizontal m-t" method="post" action="{:url('web_log')}">
					<div class="form-group">
						<label class="col-sm-3 control-label no-padding-right" for="form-field-1"> 是否开启操作日志：</label>
						<div class="col-sm-9" style="padding-top:5px;">
							<div class="onoffswitch">
                                <input name="weblog_on" id="weblog_on" type="checkbox" {if $web_log.weblog_on}checked{/if} class="onoffswitch-checkbox">
                                <label class="onoffswitch-label" for="weblog_on">
                                    <span class="onoffswitch-inner"></span>
                                    <span class="onoffswitch-switch"></span>
                                </label>
                            </div>
						</div>
					</div>
					<div class="form-group">
						<label class="col-sm-3 control-label no-padding-right" for="form-field-1"> 不记录模块：</label>
						<div class="col-sm-9">
							<select name="not_log_module[]" id="selectmodule" class="selectpicker" multiple data-width="fit">
								{foreach name="$modules" item="vo"}
								<option>{$vo}</option>
								{/foreach}
							</select>
						</div>
					</div>
					<div class="form-group">
						<label class="col-sm-3 control-label no-padding-right" for="form-field-1"> 不记录控制器：</label>
						<div class="col-sm-9">
							<select name="not_log_controller[]" id="selectcontroller" class="selectpicker" multiple data-width="fit" data-size="10" data-selected-text-format="count > 6">
								{foreach name="$modules" item="v"}
								<optgroup label="{$v}模块">
									{foreach name="$controllers[$v]" item="vv"}
									<option>{$vv}</option>
									{/foreach}
								</optgroup>
								{/foreach}
							</select>
						</div>
					</div>
					<div class="form-group">
						<label class="col-sm-3 control-label no-padding-right" for="form-field-1"> 不记录操作方法：</label>
						<div class="col-sm-9">
							<select name="not_log_action[]" id="selectaction" class="selectpicker" multiple data-width="fit" data-size="10" data-selected-text-format="count > 4">
								{foreach name="$actions" item="v" key="k"}
								<optgroup label="{$k}">
									{foreach name="$v" item="vv"}
									<option>{$k}/{$vv}</option>
									{/foreach}
								</optgroup>
								{/foreach}
							</select>
						</div>
					</div>
					<div class="form-group">
						<label class="col-sm-3 control-label no-padding-right" for="form-field-1"> 不记录数据的方法：</label>
						<div class="col-sm-9">
							<select name="not_log_data[]" id="selectdata" class="selectpicker" multiple data-width="fit" data-size="10" data-selected-text-format="count > 4">
								{foreach name="$actions" item="v" key="k"}
								<optgroup label="{$k}">
									{foreach name="$v" item="vv"}
									<option>{$k}/{$vv}</option>
									{/foreach}
								</optgroup>
								{/foreach}
							</select>
						</div>
					</div>
					<div class="form-group">
						<label class="col-sm-3 control-label no-padding-right" for="form-field-1"> 不记录请求类型：</label>
						<div class="col-sm-9">
							<select name="not_log_request_method[]" id="selectmethod" class="selectpicker" multiple data-width="fit">
								{foreach name="$methods" item="vo"}
								<option>{$vo}</option>
								{/foreach}
							</select>
						</div>
					</div>
					<div class="clearfix form-actions">
						<div class="col-sm-offset-3 col-sm-9">
							<button class="btn btn-primary" type="submit">
						<i class="fa fa-check"></i> 保存</button>
						</div>
					</div>
				</form>
			</div>
		</div>
	</div>
</div>
{/block} {block name="script"}
<script src="__LIB__/bootstrap-select/js/bootstrap-select.min.js"></script>
<script>
	$('#selectmodule').selectpicker('val', "{$web_log.not_log_module}".split(','));
	$('#selectcontroller').selectpicker('val', "{$web_log.not_log_controller}".split(','));
	$('#selectaction').selectpicker('val', "{$web_log.not_log_action}".split(','));
	$('#selectdata').selectpicker('val', "{$web_log.not_log_data}".split(','));
	$('#selectmethod').selectpicker('val', "{$web_log.not_log_request_method}".split(','));
	//顶部导航
	$("#li-bar-log").addClass("active");
	//ajax表单提交
	$("#myForm").submit(function() {
		ajaxForm();
		return false;
	});
</script>
{/block}